/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package networking;

import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import java.net.*;
import java.io.*;

public class Networking {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {

        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("123.0.0.1", 8080));


        System.getProperties().put("http.proxyHost", "10.1.100.230");
        System.getProperties().put("http.proxyPort", "3128");
        System.getProperties().put("http.proxyUser", "e.noskov");
        System.getProperties().put("http.proxyPassword", "hf,jnf");
        URL oracle = new URL("http://www.oracle.com/");
        URLConnection yc = oracle.openConnection();

        BufferedReader in = new BufferedReader(new InputStreamReader(
                yc.getInputStream()));
        String inputLine;
        while ((inputLine = in.readLine()) != null) {
            System.out.println(inputLine);
        }
        in.close();

    }
}
